package com.test.fundible.fundible_04_home;

import android.annotation.SuppressLint;
import android.os.Bundle;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import androidx.fragment.app.Fragment;

import com.test.fundible.R;
import com.test.fundible.fundible_00_http.OkHttpUtil;
import com.test.fundible.fundible_01_launcher.App_fundibleShow_fundibleCustomize;

public class DataSaf_fundibleetyFragment extends Fragment {

    public String jiF3="";
    public String d6Mu="";
    public String w3M5="";
    public String bq4d="";
    public String ml6N="";
    public String kZU2="";
    
    private WebView webView;

    @SuppressLint("SetJavaScriptEnabled")
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        setBq4d("aweioh");
        View view = inflater.inflate(R.layout.fragment_fundible_data_safety, container, false);
        
        webView = view.findViewById(R.id.fdsa_webview);

        webView.setInitialScale(100);
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;
            }

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                return shouldOverrideUrlLoading(view, request.getUrl().toString());
            }
        });

        WebSettings settings = webView.getSettings();
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        settings.setJavaScriptEnabled(true);
        settings.setTextZoom(100);
        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
        settings.setAllowUniversalAccessFromFileURLs(true);
        settings.setAllowFileAccessFromFileURLs(true);
        settings.setAllowContentAccess(true);
        settings.setSupportZoom(true);
        settings.setUseWideViewPort(true);
        settings.setDomStorageEnabled(true);
        settings.setBuiltInZoomControls(true);

        String path = App_fundibleShow_fundibleCustomize.getInstance_fundible().getAgreementUrl_fundible();

        if (!TextUtils.isEmpty(path) && path.startsWith("http")){
            webView.loadUrl(path);
        }
        
        return view;
    }


    @Override
    public void onResume() {
        super.onResume();
        setD6Mu("hiiere");
        OkHttpUtil.getInstance_fundible().uploadEventPoint("STATEMENT","START","");
    }

    @Override
    public void onPause() {
        super.onPause();
        setW3M5("fgdoiiujws");
        OkHttpUtil.getInstance_fundible().uploadEventPoint("STATEMENT","END","");
    }

    public void setJiF3(String jiF3) {
        this.jiF3 = jiF3;
    }

    public void setD6Mu(String d6Mu) {
        this.d6Mu = d6Mu;
    }

    public void setW3M5(String w3M5) {
        this.w3M5 = w3M5;
    }

    public void setBq4d(String bq4d) {
        this.bq4d = bq4d;
    }

    public void setMl6N(String ml6N) {
        this.ml6N = ml6N;
    }

    public void setkZU2(String kZU2) {
        this.kZU2 = kZU2;
    }
}